{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "from selenium import webdriver\n",
    "from selenium.webdriver.common.by import By\n",
    "import re"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "def find_name_stime(each_rows):\n",
    "    for i in each_rows:\n",
    "            each_one=i.find_elements(By.XPATH,'./a/p[1]')\n",
    "            for j in each_one:\n",
    "                if j is not None:\n",
    "                    job_name.append(j.text.split('\\n')[0])\n",
    "                    release_time.append(j.text.split('\\n')[1])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "def find_leftover(each_rows):\n",
    "    for i in each_rows:\n",
    "        each_two=i.find_elements(By.XPATH,'.//a/p[2]')\n",
    "        for j in each_two:\n",
    "            try:\n",
    "                sal=j.find_element(By.CLASS_NAME,'sal')\n",
    "            except Exception:\n",
    "                money='暂无'\n",
    "            else:\n",
    "                money=sal.text\n",
    "            salary.append(money)\n",
    "            step1=j.find_element(By.XPATH,'./span[2]')\n",
    "            step2=step1.text.split('|')\n",
    "            if len(step2)==4:\n",
    "                rest.append(step1.text)\n",
    "                where=step2[0]\n",
    "                ex=step2[1]\n",
    "                edu=step2[2]\n",
    "                need=step2[3]\n",
    "            else:\n",
    "                not_complete.append(step2)\n",
    "\n",
    "            location.append(where)\n",
    "            experience.append(ex)\n",
    "            lisence.append(edu)\n",
    "            need_num.append(need)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "def employer_info(each_rows):\n",
    "    for i in each_rows:\n",
    "        each_three=i.find_elements(By.XPATH,'.//div[2]/a')\n",
    "        for j in each_three:\n",
    "            if j is not None:\n",
    "                company.append(j.text)\n",
    "        each_four=i.find_elements(By.XPATH,'.//div[2]/p[1]')\n",
    "        for k in each_four:\n",
    "            if k is not None:\n",
    "                m=k.text.replace(' ','').split('|')\n",
    "            c_type.append(m[0])\n",
    "            try:\n",
    "                c_scale.append(m[1])\n",
    "            except Exception:\n",
    "                c_scale.append('缺失')\n",
    "        each_five=i.find_elements(By.XPATH,'.//div[2]/p[2]')\n",
    "        for n in each_five:\n",
    "            if n is not None:\n",
    "                x=n.text.split('/')\n",
    "            for z in x:\n",
    "                c_field.append(z)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "def find_ones_all(each_rows):\n",
    "    for i in each_rows:\n",
    "        if 1:\n",
    "            m=i.text.replace('\\n',' ')\n",
    "            all1.append(m)\n",
    "    return all1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "def get_deteal_url(page_url):\n",
    "    for i in page_url:\n",
    "        job.get(i)\n",
    "        each_rows=job.find_element(By.CLASS_NAME,'j_joblist').find_elements(By.CLASS_NAME,'e')\n",
    "        for j in each_rows:\n",
    "            a=j.find_element(By.TAG_NAME,'a')\n",
    "            deteal_url.append(a.get_attribute('href'))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "def get_deteal_info(url):\n",
    "    deteal_dict={}\n",
    "    first=[]\n",
    "    second=[]\n",
    "    third=[]\n",
    "    j=0\n",
    "    job.get(url)\n",
    "    job_name=job.find_element(By.XPATH,'html/body/div[3]/div[2]/div[2]/div[1]/div[1]/h1').text\n",
    "    step1=job.find_element(By.CLASS_NAME,'tCompany_main')\n",
    "    #查找前两个，岗位职务与职务要求\n",
    "    step2=step1.find_elements(By.XPATH,'./div[1]/div/p')\n",
    "    for i in step2:\n",
    "        m=i.text\n",
    "        first.append(m)\n",
    "        j=j+1\n",
    "        if m=='':\n",
    "            break\n",
    "    for i in step2[j:]:\n",
    "        second.append(i.text)\n",
    "    #查找联系方式\n",
    "    step3=step1.find_elements(By.XPATH,'./div[2]/div/p')\n",
    "    for i in step3:\n",
    "        third.append(i.text)\n",
    "    #查找公司信息\n",
    "    step4=step1.find_element(By.XPATH,'./div[3]').text\n",
    "    deteal_dict[job_name]=[first,second,third,step4]\n",
    "    return deteal_dict"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\孙繁\\AppData\\Local\\Programs\\Python\\Python37\\lib\\site-packages\\ipykernel_launcher.py:1: DeprecationWarning: executable_path has been deprecated, please pass in a Service object\n",
      "  \"\"\"Entry point for launching an IPython kernel.\n"
     ]
    }
   ],
   "source": [
    "job=webdriver.Chrome('C:\\Program Files\\Google\\Chrome\\Application\\chromedriver.exe')\n",
    "job.get('https://www.51job.com/')\n",
    "serch_point=job.find_element(By.ID,'kwdselectid')\n",
    "serch_botton=job.find_element(By.XPATH,'/html/body/div[3]/div[1]/div[1]/div[1]/button')\n",
    "serch_point.send_keys('大数据')\n",
    "serch_botton.click()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [],
   "source": [
    "job_name=[]#职位名称\n",
    "release_time=[]#发布时间\n",
    "salary=[]\n",
    "rest=[]#单位位置、工作经验要求、学历要求、招几人\n",
    "location=[]#单位位置\n",
    "experience=[]#工作经验要求\n",
    "lisence=[]#学历要求\n",
    "need_num=[]#招几人\n",
    "not_complete=[]#rest中不全的信息放在这里\n",
    "company=[]#单位名称\n",
    "c_type=[]#单位类型\n",
    "c_scale=[]#单位规模\n",
    "c_field=[]#单位涉及领域\n",
    "all1=[]#总信息\n",
    "page_url=[]#存放第一页到最后一页的url\n",
    "deteal_url=[]#存放所有详细信息的url"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "gwzw=[]#岗位职务\n",
    "rzyq=[]#职务要求\n",
    "lxfs=[]#联系方式\n",
    "gsxx=[]#公司信息"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [],
   "source": [
    "page1=job.current_url\n",
    "for i in range(1,1056):\n",
    "    url_list=list(page1)\n",
    "    #(url[-130])表示第几页的字符在url的倒数130位\n",
    "    url_list[-130]=str(i)\n",
    "    page_url.append(''.join(url_list))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [],
   "source": [
    "for i,j in zip(page_url,range(20)):\n",
    "    job.get(i)\n",
    "    each_rows=job.find_elements(By.CLASS_NAME,'e')#找到存放职位的信息元素们,存在each_rows列表中\n",
    "    employer_info(each_rows)\n",
    "    find_leftover(each_rows)\n",
    "    find_name_stime(each_rows)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "get_deteal_url(page_url)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "ename": "NoSuchElementException",
     "evalue": "Message: no such element: Unable to locate element: {\"method\":\"xpath\",\"selector\":\"./div[3]\"}\n  (Session info: chrome=96.0.4664.45)\nStacktrace:\nBacktrace:\n\tOrdinal0 [0x002F0C43+2493507]\n\tOrdinal0 [0x0028A4B1+2073777]\n\tOrdinal0 [0x00192608+1058312]\n\tOrdinal0 [0x001BCAA4+1231524]\n\tOrdinal0 [0x001B3621+1193505]\n\tOrdinal0 [0x001D597A+1333626]\n\tOrdinal0 [0x001B35A6+1193382]\n\tOrdinal0 [0x001D5A2A+1333802]\n\tOrdinal0 [0x001E5038+1396792]\n\tOrdinal0 [0x001D580B+1333259]\n\tOrdinal0 [0x001B2314+1188628]\n\tOrdinal0 [0x001B316F+1192303]\n\tGetHandleVerifier [0x00477BF6+1548950]\n\tGetHandleVerifier [0x0052461C+2256060]\n\tGetHandleVerifier [0x0037C13B+518107]\n\tGetHandleVerifier [0x0037B1E0+514176]\n\tOrdinal0 [0x0028F53D+2094397]\n\tOrdinal0 [0x00293418+2110488]\n\tOrdinal0 [0x00293552+2110802]\n\tOrdinal0 [0x0029CE81+2150017]\n\tBaseThreadInitThunk [0x75AEFA29+25]\n\tRtlGetAppContainerNamedObjectPath [0x77247A9E+286]\n\tRtlGetAppContainerNamedObjectPath [0x77247A6E+238]\n\t(No symbol) [0x00000000]\n",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mNoSuchElementException\u001b[0m                    Traceback (most recent call last)",
      "\u001b[1;32m~\\AppData\\Local\\Temp/ipykernel_5700/3078731772.py\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[0;32m      1\u001b[0m \u001b[0mfile1\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mopen\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m'F:\\Code\\python爬取招聘网信息\\详情页.txt'\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;34m'w'\u001b[0m\u001b[1;33m,\u001b[0m\u001b[0mencoding\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;34m'utf-8'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      2\u001b[0m \u001b[1;32mfor\u001b[0m \u001b[0mi\u001b[0m \u001b[1;32min\u001b[0m \u001b[0mdeteal_url\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;36m0\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;36m26\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 3\u001b[1;33m     \u001b[0mfile1\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mwrite\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mstr\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mget_deteal_info\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mi\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m      4\u001b[0m \u001b[0mfile1\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mclose\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32m~\\AppData\\Local\\Temp/ipykernel_5700/2009705512.py\u001b[0m in \u001b[0;36mget_deteal_info\u001b[1;34m(url)\u001b[0m\n\u001b[0;32m     23\u001b[0m         \u001b[0mthird\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mappend\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mi\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mtext\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m     24\u001b[0m     \u001b[1;31m#查找公司信息\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m---> 25\u001b[1;33m     \u001b[0mstep4\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mstep1\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mfind_element\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mBy\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mXPATH\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;34m'./div[3]'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mtext\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m     26\u001b[0m     \u001b[0mdeteal_dict\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mjob_name\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mfirst\u001b[0m\u001b[1;33m,\u001b[0m\u001b[0msecond\u001b[0m\u001b[1;33m,\u001b[0m\u001b[0mthird\u001b[0m\u001b[1;33m,\u001b[0m\u001b[0mstep4\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m     27\u001b[0m     \u001b[1;32mreturn\u001b[0m \u001b[0mdeteal_dict\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32m~\\AppData\\Local\\Programs\\Python\\Python37\\lib\\site-packages\\selenium\\webdriver\\remote\\webelement.py\u001b[0m in \u001b[0;36mfind_element\u001b[1;34m(self, by, value)\u001b[0m\n\u001b[0;32m    717\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    718\u001b[0m         return self._execute(Command.FIND_CHILD_ELEMENT,\n\u001b[1;32m--> 719\u001b[1;33m                              {\"using\": by, \"value\": value})['value']\n\u001b[0m\u001b[0;32m    720\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    721\u001b[0m     \u001b[1;32mdef\u001b[0m \u001b[0mfind_elements\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mby\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mBy\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mID\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mvalue\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;32mNone\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32m~\\AppData\\Local\\Programs\\Python\\Python37\\lib\\site-packages\\selenium\\webdriver\\remote\\webelement.py\u001b[0m in \u001b[0;36m_execute\u001b[1;34m(self, command, params)\u001b[0m\n\u001b[0;32m    691\u001b[0m             \u001b[0mparams\u001b[0m \u001b[1;33m=\u001b[0m \u001b[1;33m{\u001b[0m\u001b[1;33m}\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    692\u001b[0m         \u001b[0mparams\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m'id'\u001b[0m\u001b[1;33m]\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_id\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 693\u001b[1;33m         \u001b[1;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_parent\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mexecute\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mcommand\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mparams\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m    694\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    695\u001b[0m     \u001b[1;32mdef\u001b[0m \u001b[0mfind_element\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mby\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mBy\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mID\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mvalue\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;32mNone\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;32m~\\AppData\\Local\\Programs\\Python\\Python37\\lib\\site-packages\\selenium\\webdriver\\remote\\webdriver.py\u001b[0m in \u001b[0;36mexecute\u001b[1;34m(self, driver_command, params)\u001b[0m\n\u001b[0;32m    416\u001b[0m         \u001b[0mresponse\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mcommand_executor\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mexecute\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mdriver_command\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mparams\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    417\u001b[0m         \u001b[1;32mif\u001b[0m \u001b[0mresponse\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 418\u001b[1;33m             \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0merror_handler\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mcheck_response\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mresponse\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m    419\u001b[0m             response['value'] = self._unwrap_value(\n\u001b[0;32m    420\u001b[0m                 response.get('value', None))\n",
      "\u001b[1;32m~\\AppData\\Local\\Programs\\Python\\Python37\\lib\\site-packages\\selenium\\webdriver\\remote\\errorhandler.py\u001b[0m in \u001b[0;36mcheck_response\u001b[1;34m(self, response)\u001b[0m\n\u001b[0;32m    241\u001b[0m                 \u001b[0malert_text\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mvalue\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;34m'alert'\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mget\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m'text'\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    242\u001b[0m             \u001b[1;32mraise\u001b[0m \u001b[0mexception_class\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mmessage\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mscreen\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mstacktrace\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0malert_text\u001b[0m\u001b[1;33m)\u001b[0m  \u001b[1;31m# type: ignore[call-arg]  # mypy is not smart enough here\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 243\u001b[1;33m         \u001b[1;32mraise\u001b[0m \u001b[0mexception_class\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mmessage\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mscreen\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mstacktrace\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m    244\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m    245\u001b[0m     \u001b[1;32mdef\u001b[0m \u001b[0m_value_or_default\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mobj\u001b[0m\u001b[1;33m:\u001b[0m \u001b[0mMapping\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0m_KT\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0m_VT\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mkey\u001b[0m\u001b[1;33m:\u001b[0m \u001b[0m_KT\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mdefault\u001b[0m\u001b[1;33m:\u001b[0m \u001b[0m_VT\u001b[0m\u001b[1;33m)\u001b[0m \u001b[1;33m->\u001b[0m \u001b[0m_VT\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;31mNoSuchElementException\u001b[0m: Message: no such element: Unable to locate element: {\"method\":\"xpath\",\"selector\":\"./div[3]\"}\n  (Session info: chrome=96.0.4664.45)\nStacktrace:\nBacktrace:\n\tOrdinal0 [0x002F0C43+2493507]\n\tOrdinal0 [0x0028A4B1+2073777]\n\tOrdinal0 [0x00192608+1058312]\n\tOrdinal0 [0x001BCAA4+1231524]\n\tOrdinal0 [0x001B3621+1193505]\n\tOrdinal0 [0x001D597A+1333626]\n\tOrdinal0 [0x001B35A6+1193382]\n\tOrdinal0 [0x001D5A2A+1333802]\n\tOrdinal0 [0x001E5038+1396792]\n\tOrdinal0 [0x001D580B+1333259]\n\tOrdinal0 [0x001B2314+1188628]\n\tOrdinal0 [0x001B316F+1192303]\n\tGetHandleVerifier [0x00477BF6+1548950]\n\tGetHandleVerifier [0x0052461C+2256060]\n\tGetHandleVerifier [0x0037C13B+518107]\n\tGetHandleVerifier [0x0037B1E0+514176]\n\tOrdinal0 [0x0028F53D+2094397]\n\tOrdinal0 [0x00293418+2110488]\n\tOrdinal0 [0x00293552+2110802]\n\tOrdinal0 [0x0029CE81+2150017]\n\tBaseThreadInitThunk [0x75AEFA29+25]\n\tRtlGetAppContainerNamedObjectPath [0x77247A9E+286]\n\tRtlGetAppContainerNamedObjectPath [0x77247A6E+238]\n\t(No symbol) [0x00000000]\n"
     ]
    }
   ],
   "source": [
    "file1=open('F:\\Code\\python爬取招聘网信息\\详情页.txt','w',encoding='utf-8')\n",
    "for i in deteal_url[0:26]:\n",
    "    file1.write(str(get_deteal_info(i)))\n",
    "file1.close()"
   ]
  }
 ],
 "metadata": {
  "interpreter": {
   "hash": "ab3b2bc5bebddef6f9f114f8f7874e25922ccee8f7a61d3329d2b768a4e87fb1"
  },
  "kernelspec": {
   "display_name": "Python 3.7.9 64-bit (system)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.9"
  },
  "orig_nbformat": 4
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
